#pragma once

#include "Component.h"
#include "Point.h"
#include "SignalSlot.h"

namespace game_engine { namespace components
{

/*!
 * \class Transformation
 * \brief 
 */
class Transformation : public Component
{
///////////////////////////////////////////////////////////////////////////////
// Attribute definition
///////////////////////////////////////////////////////////////////////////////
public:
    cSignal<INT32, GameObject*> signalPositionUpdated;
    cSignal<INT32, utils::Point> signalNewPosition;

private:
    FLOAT32 xPosition;
    FLOAT32 yPosition;
    FLOAT32 xRotation;
    FLOAT32 yRotation;
    FLOAT32 xScale;
    FLOAT32 yScale;
    FLOAT32 previousXPos;
    FLOAT32 previousYPos;

///////////////////////////////////////////////////////////////////////////////
// Method definition
///////////////////////////////////////////////////////////////////////////////
public:
    // Constructors and Destructors
    Transformation(void);
    Transformation(GameObject *obj, const FLOAT32 xpos, const FLOAT32 ypos, 
        const FLOAT32 xrot, const FLOAT32 yrot, const FLOAT32 xscl, 
        const FLOAT32 yscl);
    virtual ~Transformation(void);

    // Others
    void revertPosition(void);

    // Getters
    const utils::Point getPosition(void) const;
    const utils::Point getPreviousPosition(void) const;
    const FLOAT32 getXPosition(void) const;
    const FLOAT32 getYPosition(void) const;

    // Setters
    void setPosition(const utils::Point &pos);
    void setXPosition(const FLOAT32 xPos);
    void setYPosition(const FLOAT32 yPos);

};

}}
